extends Polygon2D

onready var MAIN = find_parent("MAIN")
class_name Star

func _process(delta: float) -> void:
	position.x += MAIN.speed * delta * 0.3
	if position.x <= -40:
		queue_free()

func _init(poly:Polygon2D) -> void:
	polygon = poly.polygon

func _ready() -> void:
	self.scale = Vector2.ONE*rand_range(0,0.5)
	self.rotation = rand_range(0, 2 * PI)
